package org.apache.ibatis.binding;

import java.util.List;

import org.apache.ibatis.annotations.Arg;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.ConstructorArgs;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.domain.blog.Author;
import org.apache.ibatis.domain.blog.Blog;

@CacheNamespace(readWrite = false)
public interface BoundBlogMapperMY {

	@Select("SELECT * FROM " + "blog WHERE id = #{id}")
	@ConstructorArgs({ @Arg(column = "id", javaType = int.class, id = true),
			@Arg(column = "title", javaType = String.class),
			@Arg(column = "author_id", javaType = Author.class, select = "org.apache.ibatis.binding.BoundAuthorMapper.selectAuthor"),
			@Arg(column = "id", javaType = List.class, select = "selectPostsForBlog") })
	Blog selectBlogUsingConstructor(int id);

	//@//Select("SELECT * FROM blog " + "WHERE id = #{id} AND title = #{nonExistentParam,jdbcType=VARCHAR}")
	@Select("SELECT * FROM blog " + "WHERE id = #{id}")
	Blog selectBlogByNonExistentParam(@Param("id") int id);
	
	
}
